using UnityEngine;
using System.Collections;

public class MapCreator : MonoBehaviour 
{
	public Transform tileObject;
	float positionZero = -9.5f;
	Vector2 mapMatrix = new Vector2(20,20);
	
	
	void Awake()
	{
		for(int i = 0; i < mapMatrix.y; i++)
		{
			for(int j = 0;j < mapMatrix.x ;j++)
			{
				CreateMap(new Vector3(positionZero+j, positionZero+i, 0.1f));
			}
		}
	}
	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
	
	}
	
	void CreateMap(Vector3 tilePosition)
	{
		Transform clone;
		
		clone = Instantiate(tileObject,tilePosition,Quaternion.identity) as Transform;
	}
	
}
